﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Subfaculty.Common;
using Subfaculty.Common.Entities;
using Subfaculty.Common.Interfaces.Services;

namespace Subfaculty.Infrastructure.Services
{

	public class DistributationLoadItem : IDistributationLoadItem
	{
		public IEnumerable<StudyLoadItem> Distributation(IEnumerable<StudyLoadItem> studyLoadItems, Teacher teacher)
		{
            foreach (var item in studyLoadItems)
            {
                item.Teacher = teacher;
                yield return item;
            }
		}

		public IEnumerable<StudyLoadItem> UnDistributation(IEnumerable<StudyLoadItem> studyLoadItems, Teacher teacher)
		{
            foreach (var item in studyLoadItems)
            {
                item.Teacher = null;
                yield return item;
            }
		}
	}
}
